oracle.hadoop.balancer.examples.invindx

## Class InvertedIndex.InvertedIndexKey

- java.lang.Object
- - oracle.hadoop.balancer.examples.invindx.InvertedIndex.InvertedIndexKey

- All Implemented Interfaces:
    org.apache.hadoop.io.Writable
  Enclosing class:
    InvertedIndex

      public static class InvertedIndex.InvertedIndexKey
      extends java.lang.Object
      implements org.apache.hadoop.io.Writable

  Key class for the inverted index application. Since we want Hadoop to do a secondary sort (produce a sorted list of reduce values per key), we have a composite key class that contains both key and value elements.
  - Sorting comparator is `InvertedIndex.InvertedIndexKey.SortingComparator`
  - Grouping comparator is `InvertedIndex.InvertedIndexKey.GroupingComparator`
  - Partitioner is `InvertedIndex.InvertedIndexKey.WordPartitioner`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `InvertedIndex.InvertedIndexKey.GroupingComparator` This comparator compares only the key element (the word) of this composite key class.
    `static class` | `InvertedIndex.InvertedIndexKey.SortingComparator` This comparator extends `InvertedIndex.InvertedIndexKey.GroupingComparator` and compares the value elements (location and offset) of this composite key.
    `static class` | `InvertedIndex.InvertedIndexKey.WordPartitioner<V>` Partition on the word's hash code.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvertedIndex.InvertedIndexKey()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `hashCode()`
    `void` | `readFields(java.io.DataInput in)`
    `java.lang.String` | `toString()` TextOutputFormat calls this to print the key
    `void` | `write(java.io.DataOutput out)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### InvertedIndex.InvertedIndexKey

          public InvertedIndex.InvertedIndexKey()

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### readFields

          public void readFields(java.io.DataInput in)
                          throws java.io.IOException

      Specified by:
        `readFields` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `java.io.IOException`

    - #### toString

          public java.lang.String toString()

      TextOutputFormat calls this to print the key
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the word for this key

    - #### write

          public void write(java.io.DataOutput out)
                     throws java.io.IOException

      Specified by:
        `write` in interface `org.apache.hadoop.io.Writable`
      Throws:
        `java.io.IOException`

Copyright © 2013, 2016, Oracle and/or its affiliates. All rights reserved.